package com.winsdom.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class PaymentReceiptImportDTO {

    @ExcelProperty("收款时间")
    @NotNull(message = "收款时间不为空")  // 改为NotNull
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 添加日期格式注解
    private LocalDateTime receiptTime;

    @ExcelProperty("收款流水号")
    @NotBlank(message = "收款流水号不为空")
    private String receiptSerial;

    @ExcelProperty("支付流水号")
    @NotBlank(message = "支付流水号不为空")
    private String paymentSerial;

    @ExcelProperty("付款人")
    @NotBlank(message = "付款人不为空")
    private String payerName;

    @ExcelProperty("付款方式")
    @NotBlank(message = "付款方式不为空")
    private String paymentMethodStr;

    @ExcelIgnore
    private Integer paymentMethod;

    @ExcelProperty("收款人")
    private String payeeName;

    @ExcelProperty("收款账号")
    @NotBlank(message = "收款账号不为空")
    private String payeeAccount;

    @ExcelProperty("收款金额")
    @NotNull(message = "收款金额不为空")  // 改为NotNull
    @DecimalMin(value = "0.01", message = "收款金额必须大于0")
    private BigDecimal receiptAmount;

    @ExcelProperty("备注")
    private String remark;
}